package com.hand.exam.service.impl;

import com.hand.exam.domain.Matter;
import com.hand.exam.mapper.MatterMapper;
import com.hand.exam.service.IMatterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 马旭阳
 * @date2019/7/20
 */
@Service
public class MatterServiceImpl implements IMatterService {
    @Autowired
    private MatterMapper matterMapper;
    @Override
    public Matter queryMatterById(Long id) {
        return matterMapper.queryMatterById(id);
    }

    @Override
    public Matter queryMatter(Matter matter) {

        return matterMapper.queryMatter(matter);
    }

    @Override
    public void insertMatter(Matter matter) {
         matterMapper.insertMatter(matter);
    }

    @Override
    public void updateMatter(Matter matter) {
        matterMapper.updateMatter(matter);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteMatter(Long id) {
        matterMapper.deleteMatter(id);
    }

    @Override
    public Matter queryMatterByName(String name) {
        return matterMapper.queryMatterByName(name);
    }
}
